<template>
  123123123123
  {{ title }}
  <ul v-for="item in fatherArr">
      <li>{{ item.name }}</li>
      <li>{{ item.age }}</li>
  </ul>
  <button @click="submit">派发</button>
</template>

<script setup lang='ts'>
import { reactive, ref } from 'vue';

type NT = {
    name: string,
    age: number
}
type Props = {
    title?:string,
    fatherArr?:NT[]
}

withDefaults(defineProps<Props>(),{
    title:'默认title',
    fatherArr: ()=> []
    
})

const list = reactive<NT[]>([
    {
        name : '张三',
        age : 18
    },
    {
        name : '张三',
        age : 18
    },
    {
        name : '张三',
        age : 18
    }
])

const flag = ref(false)

const emit = defineEmits(['on-click:submit'])

const submit =  () => {
    emit('on-click:submit',list,flag.value)
}

defineExpose({
    list,
    flag
})


</script>

<style lang='scss' scoped>

</style>
